package com.wesley.factory.pizza;

/**
 * <h1>概述</h1>
 * <p>详述</p>
 *
 * @Date: 2021/8/11
 */
public class SimpleFactory {

    public Pizza createPizza(String name) {
        Pizza pizza = null;
        if (name.equals("greek")) {
            pizza = new GreekPizza();
            pizza.setName("希腊");
        } else if (name.equals("fruit")) {
            pizza = new FruitPizza();
            pizza.setName("水果");
        }
        return pizza;
    }

}
